package com.lottery.material.service.portal.promotion.impl;

import com.lottery.material.dao.promotion.PromotionRuleConfigMapper;
import com.lottery.material.pojo.promotion.PromotionRuleConfig;
import com.lottery.material.service.portal.promotion.PromotionRuleConfigService;
import com.lottery.material.vo.portal.article.ArticlePromotionRuleVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Description:    推广规则配置服务实现类
 * Author:         sunny
 * CreateDate:     2019-04-26 15:08
 */
@Service
public class PromotionRuleConfigServiceImpl implements PromotionRuleConfigService {

    @Autowired
    private PromotionRuleConfigMapper promotionRuleConfigMapper;

    /**
     * description: 根据推广类型查询
     * author sunny
     * createDate 2019-04-26 下午 3:10
     * @param promotionType
     * @return
     */
    @Override
    public PromotionRuleConfig findByPromotionType(Integer promotionType) {
        return promotionRuleConfigMapper.findByPromotionType(promotionType);
    }

    /**
     * description: 根据推广类型查询Vo
     * author sunny
     * createDate 2019-04-29 上午 11:15
     * @param promotionType
     * @return
     */
    @Override
    public ArticlePromotionRuleVo findVoByPromotionType(Integer promotionType) {
        return promotionRuleConfigMapper.findVoByPromotionType(promotionType);
    }
}
